<%@ page import="com.example.pojo.Member" %>
<%@ page import="java.util.List" %>
<%@ page import="com.example.pojo.Coach" %>
<%@ page import="com.example.pojo.Course" %>
<%@ page import="com.example.dao.*" %>
<%@ page import="com.example.pojo.Equipment" %><%--
  Created by IntelliJ IDEA.
  User: LSK
  Date: 2020/4/19
  Time: 22:39
  To change this template use File | Settings | File Templates.
--%>
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="bootstrap/css/font-awesome.css" rel="stylesheet">
<link href="bootstrap/css/animate.css" rel="stylesheet">
<link href="bootstrap/css/style.css" rel="stylesheet">
<link href="bootstrap/css/plugins/iCheck/custom.css" rel="stylesheet">
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>会员详情页面</title>
</head>
<body>
<div class="container">

    <%
        Member member1 = new LoginDao().memberLogin(
                request.getParameter("user"),
                request.getParameter("pass"));
        /*out.print( request.getParameter("user"));
        out.print( request.getParameter("pass"));*/

        out.print("<h1> 欢迎您，尊贵的"+member1.getLevel()+":"+member1.getName()+
                "("+member1.getPhone()+")"+"</h1>");
    %>
    <table class="table table-hover table-bordered">
        <caption>
            <h2>教练资料浏览</h2>
        </caption>
        <thead>
        <tr>
            <th>教练编号</th>
            <th>教练姓名</th>
            <th>年龄</th>
            <th>性别</th>
            <th>手机号码</th>
        </tr>
        </thead>
        <tbody>
        <%
            CoachDao dao=new CoachDao();
            List<Coach> coaches = dao.coachList();
            for (Coach coach : coaches) {
                out.print("<tr>");
                out.print("<td>"+coach.getId()+"</td>");
                out.print("<td>"+coach.getName()+"</td>");
                out.print("<td>"+coach.getAge()+"</td>");
                out.print("<td>"+coach.getSex()+"</td>");
                out.print("<td>"+coach.getPhone()+"</td>");
                out.print("</tr>");
            }
        %>
        </tbody>
    </table>

    <table class="table table-hover table-bordered">
        <caption>
            <h2>课程信息浏览</h2>
        </caption>
        <thead>
        <tr>
            <th>课程编号</th>
            <th>课程日期</th>
            <th>课程名称</th>
            <th>课程详细内容</th>
            <th>教练</th>
        </tr>
        </thead>
        <tbody>
        <%
            CourseDao dao2=new CourseDao();
            for(Course course:dao2.courseList())
            {
                out.print("<tr>");
                out.print("<td>"+course.getId()+"</td>");
                out.print("<td>"+course.getDate()+"</td>");
                out.print("<td>"+course.getCourse_name()+"</td>");
                out.print("<td>"+course.getCourse_content()+"</td>");
                out.print("<td>"+course.getTeacher()+"</td>");
                out.print("</tr>");
            }
        %>
        </tbody>
    </table>

    <table class="table table-hover table-bordered">
        <caption>
            <h2>健身器材信息浏览</h2>
        </caption>
        <thead>
        <tr>
            <th>器材编号</th>
            <th>器材名称</th>
            <th>购置日期</th>
            <th>总数</th>
            <th>当前空闲总数</th>
        </tr>
        </thead>
        <tbody>
        <%
            EquipDao dao3=new EquipDao();
            for(Equipment equipment:dao3.selectEquipments(true))
            {
                out.print("<tr>");
                out.print("<td>"+equipment.getId()+"</td>");
                out.print("<td>"+equipment.getName()+"</td>");
                out.print("<td>"+equipment.getDate()+"</td>");
                out.print("<td>"+equipment.getCount()+"</td>");
                out.print("<td>"+equipment.getFree_count()+"</td>");
                out.print("</tr>");
            }
        %>
        </tbody>
    </table>
</div>
    <script src="bootstrap/js/bootstrap.min.js"></script>
    <script src="bootstrap/js/jquery.min.js"></script>
</body>
</html>
